package cn.com.iresearch.android.componentizationsupporter

import android.util.Log


/**
 * 空组件
 * 当通过路由获取组件时找不到相应的组件名的组件，则返回这个空组件实例
Created By: Seal.Wu
Date: 2018/4/3
Time: 14:27
 */
object EmptyComponent : IComponent {
    private const val EMPTY_NAME = "Empty-Component"
    override fun getComponentName(): String {
        return EMPTY_NAME
    }

    override fun execute(commandLine: String, vararg commandLineArgs: Any): Any {
        Log.w(Constants.tag,"Now are executing a commandline with the $EMPTY_NAME")
        return Any()
    }

    override fun executeAsync(commandLine: String, vararg commandLineArgs: Any, callback: (response: Any) -> Unit) {
        Log.w(Constants.tag,"Now are executing a commandline with the $EMPTY_NAME")
        callback(Unit)
    }
}